<!DOCTYPE html>
<html lang="zh">
<head>
    <title>配置管理 - virus CMS</title>
    {include file="common/meta" /}
</head>
<body>

<!-- Navbar -->
{include file="common/header" /}
<!-- /Navbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
        {include file="common/sidebar" /}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li class="active">
                        <i class="fa fa-home"></i>&nbsp;控制面板
                    </li>
                    <li>
                        <i class="fa fa-cogs"></i> 常规管理
                    </li>
                    <li>
                        <i class=""></i> 配置管理
                    </li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="widget flat radius-bordered">
                            <div class="widget-header bg-themeprimary">
                                <span class="widget-caption">网站配置</span>
                            </div>

                            <div class="widget-body">
                                <div class="widget-main ">
                                    <div class="tabbable">
                                        <ul class="nav nav-tabs tabs-flat" id="myTab11">
                                            {foreach $config_groups as $key => $group}
                                            <li class="{if $key eq 0}active{/if}">
                                                <a data-toggle="tab" data-id="{$group.id}" onclick="getConfigData(obj)"
                                                   href="#{$group.group_name}">
                                                    {$group.group_title}
                                                </a>
                                            </li>
                                            {/foreach}
                                        </ul>
                                        <div class="tab-content tabs-flat">
                                            {foreach $config_groups as $key => $group}
                                            <div id="{$group.group_name}" class="tab-pane {if $key eq 0}in active{/if}">
                                                <form action="{:url('Config/webConfig')}" method="post" class="form-horizontal">
                                                    {foreach $group['configs'] as $key => $v}
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label no-padding-right">{$v['config_desc']}:</label>
                                                        <div class="col-sm-6">
                                                            {switch $v['config_type']}
                                                            {case string}
                                                            <input type="text" name="config[{$v.config_id}][config_value]"
                                                                   value="{$v['config_value']}" class="form-control">
                                                            {/case}
                                                            {case radio}
                                                            <div class="radio">
                                                                {foreach $v['config_info'] as $k1 => $v1}
                                                                <label>
                                                                    <input name="config[{$v.config_id}][config_value]" type="radio"
                                                                           value="{$v1['0']}" {if condition="$v['config_value'] eq $v1['0']" }checked{/if} class="colored-blue">
                                                                    <span class="text"> {$v1['1']}</span>
                                                                </label>
                                                                {/foreach}
                                                            </div>
                                                            {/case}
                                                            {case select}
                                                            <select name="config[{$v.config_id}][config_value]"class="form-control">
                                                                {foreach $v['config_info'] as $k1 => $v1}
                                                                <option value="{$v1['0']}" {if condition="$v['config_value'] eq $v1['0']"}selected{/if}>{$v1['1']}</option>
                                                                {/foreach}
                                                            </select>
                                                            {/case}
                                                            {case textarea}
                                                            <textarea type="text" name="config[{$v.config_id}][config_value]" class="form-control">{$v['config_value']}</textarea>
                                                            {/case}
                                                            {/switch}
                                                        </div>
                                                    </div>
                                                    {/foreach}
                                                    <div class="form-group">
                                                        <div class="col-sm-offset-2 col-sm-10">
                                                            <button type="submit" id=""
                                                                    class="btn btn-primary">确定
                                                            </button>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>
                                            {/foreach}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6 col-sm-6 col-xs-12">
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

{include file="common/script" /}
</body>
<!--  /Body -->
</html>
